#include <stdlib.h>
#include <SDL/SDL.h>
#include <unistd.h>
#include "geneticoperations.h"


typedef struct Drawing{
	Triangle* triangles;
	int numTriangles;
};


int main(int argc, char *argv[])
{
	
	SDL_Surface *screen;
	screen = SDL_SetVideoMode(640, 480, 24, SDL_SWSURFACE);
	if ( screen == NULL ) {
		fprintf(stderr, "Unable to set 640x480 video: %s\n", SDL_GetError());
		exit(1);
	}
	Triangle t;
	Point p1,p2,p3;
	Color cl;
	cl.r = 255;
	cl.g = 255;
	cl.b = 255;
	cl.a = 0.01;
	t.cl = cl;
		
	p1.x = 250;
	p1.y = 100;
	p2.x = 100;
	p2.y = 100;
	p3.x = 400;
	p3.y = 400;
	t.points[0] = p1;
	t.points[1] = p2;
	t.points[2] = p3;
		
	int i;
	for (i = 0; i < 40000; i++){
		DrawTriangle(screen,t);	
		SDL_UpdateRect(screen, 0, 0, screen->w, screen->h);
		sleep(1);
	}
		
		
	for (i = 0; i < 1000000000; i++){
		sleep(1);
	}
	atexit(SDL_Quit);
	
}


